#define _CRT_SECURE_NO_WARNINGS

#include "List.h"

void Test1()
{
	ListNode* pList = NULL;
	pList = ListCreate(pList);

	ListPushBack(pList, 1);
	ListPushBack(pList, 2);
	ListPushBack(pList, 3);
	ListPushBack(pList, 4);

	ListPrint(pList);

	ListDestory(pList);
}

void Test2()
{
	ListNode* pList = NULL;
	pList = ListCreate(pList);

	ListPushBack(pList, 1);
	ListPushBack(pList, 2);
	ListPushBack(pList, 3);
	ListPushBack(pList, 4);

	ListPopBack(pList);
	ListPopBack(pList);
	ListPopBack(pList);
	ListPopBack(pList);

	ListPrint(pList);

	ListDestory(pList);
}

void Test3()
{
	ListNode* pList = NULL;
	pList = ListCreate(pList);

	ListPushFront(pList, 1);
	ListPushFront(pList, 2);

	ListPopFront(pList);
	ListPopFront(pList);

	ListPrint(pList);

	ListDestory(pList);
}

void Test4()
{
	ListNode* pList = NULL;
	pList = ListCreate(pList);

	ListPushBack(pList, 1);
	ListPushBack(pList, 2);
	ListPushBack(pList, 3);
	ListPushBack(pList, 4);

	ListNode* pos = ListFind(pList, 2);

	ListInsert(pos, 20);
	ListErase(pos);

	ListPrint(pList);

	ListDestory(pList);
}

int main()
{
	Test4();

	return 0;
}